<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import = "ds.ChatWebService" %>
 <%@ page import = "ds.ChatService" %>
 <jsp:useBean id = "chatWebService" scope = "session" class = "ds.ChatWebService">
 </jsp:useBean>

 
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%ChatService proxy = chatWebService.getChatServicePort();
        java.util.List<ds.Message> messages =  proxy.readMessage();

        java.lang.StringBuilder texts = new StringBuilder();
        
         for (int i=0; i<messages.size(); i++) {
            texts.append(messages.get(i).getSender()+": "+messages.get(i).getText()+"\n");
         }
        %>
        <jsp:forward page="Send_receive_messages.jsp">
            <jsp:param name= "texts">
                <jsp:attribute name="value" >
                    <%= texts%>
                </jsp:attribute>
            </jsp:param>
        </jsp:forward>
    </body>
</html>
